package com.example.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * ClassName:ThreeList
 * Description:
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ThreeList {
    private String label;
    private List<ThreeList> children;

    public ThreeList(String label) {
        this.label = label;
        this.children = new ArrayList<>(); // 确保 children 列表被初始化
    }

    public void addChild(ThreeList child) {
        this.children.add(child);
    }

    public String getLabel() {
        return label;
    }

    public List<ThreeList> getChildren() {
        return children;
    }
}

